hfrApp.registerCtrl("SummaryController", function ($scope, $http, $log, $window, $translate, $rootScope, $timeout, HfrConfig, HfrInit) {
	//Init message alert
	HfrInit.message();
	
	//Display meta header
	HfrConfig.displayMeta("summary");
	
	//Delay content for display after 0,8 second
	$timeout(function () {
		$scope.showViewContent = true;
	}, 800);
	
	//Get all blog
	var blogCustomerUrl = HfrConfig.ApiServiceUrl.blogsUrlApi + "?customerId=" + $rootScope.username; 
	$scope.customerId = $rootScope.username;
	$http.get(blogCustomerUrl)
		.success(function (data) {
			$scope.blogs = data.response.blogs;
			$scope.totalBlogs = Object.keys(data.response.blogs).length;
		})
		.error(function (data) {
			$rootScope.message.error = true;
	    	$rootScope.message.text = $translate.instant("message.error.connect");
		});
	
	//Get all selector
	var selectorUrl = HfrConfig.ApiServiceUrl.selectorsUrlApi + "?customerId=" + $rootScope.username;
	$http.get(selectorUrl)
		.success(function (data) {
			$scope.selectors = data.response.selectors;
			$scope.totalSelectors = Object.keys(data.response.selectors).length;
		})
		.error(function (data) {
			$rootScope.message.error = true;
	    	$rootScope.message.text = $translate.instant("message.error.connect");
		});
});